package com.production.CoursePlatform.service;

import com.production.CoursePlatform.entity.Teacher;
import com.production.CoursePlatform.mapper.TeacherMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherService {


    @Autowired
    private TeacherMapper teacherMapper;


    public Teacher findTeacherByTID(String tID) {
        return teacherMapper.findByTID(tID);
    }


    public int addTeacher(Teacher teacher) {
        return teacherMapper.insertTeacher(teacher);
    }


    public int updateTeacher(Teacher teacher) {
        return teacherMapper.updateTeacher(teacher);
    }


    public int deleteTeacher(String tID) {
        return teacherMapper.deleteByTID(tID);
    }


    public List<Teacher> findAllTeachers() {
        return teacherMapper.selectList(null);

    }
}
